package com.apes.fa.respository;

import com.apes.fa.model.FaExtractAssetDepreciation;
import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.masterdata.party.model.PartyRole;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

public interface FaExtractAssetDepreciationRepository extends CustomRepository<FaExtractAssetDepreciation,String> {


    @Query("SELECT T FROM FaExtractAssetDepreciation T WHERE T.creator = :creator " +
            "AND T.company = :company AND TO_CHAR(T.createDate,'YY-MM') = TO_CHAR(:date,'YY-MM')")
    List<FaExtractAssetDepreciation> findByTime(@Param("creator") String creator, @Param("company") PartyRole company, @Param("date") Date date);
}
